CREATE TABLE [dbo].[tr_File](
	[FileId] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[EntryDt] [datetime] NOT NULL,
	[ProjectId] [uniqueidentifier] NOT NULL,
	[FileLocation] [varchar](max) NOT NULL,
	[EmailId] [uniqueidentifier] NOT NULL,
	[DeletedInd] [bit] NOT NULL,
	[ArchivedInd] [bit] NOT NULL,
	[FileName] [varchar](max) NOT NULL,
	[MimeType] [varchar](max) NOT NULL,
	[FileData] [varbinary](max) NOT NULL,
	[LastUpdatedDt] [datetime] NOT NULL,
 CONSTRAINT [PK_tr_File] PRIMARY KEY CLUSTERED 
(
	[FileId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[tr_File] ADD  CONSTRAINT [DF_tr_File_FileId]  DEFAULT (newid()) FOR [FileId]
GO

ALTER TABLE [dbo].[tr_File] ADD  CONSTRAINT [DF_tr_File_EntryDt]  DEFAULT (getdate()) FOR [EntryDt]
GO

ALTER TABLE [dbo].[tr_File] ADD  CONSTRAINT [DF_tr_File_DeletedInd]  DEFAULT ((0)) FOR [DeletedInd]
GO

ALTER TABLE [dbo].[tr_File] ADD  CONSTRAINT [DF_tr_File_ArchivedInd]  DEFAULT ((0)) FOR [ArchivedInd]
GO

ALTER TABLE [dbo].[tr_File] ADD  CONSTRAINT [DF_tr_File_LastUpdatedDt]  DEFAULT (getdate()) FOR [LastUpdatedDt]
GO

